﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Test_Mock1G3
{
    class Utility
    {
        public static bool CompareDataTable(DataTable table11, DataTable table2)
        {
            if ((table11 == null) && (table2 == null))
            {
                return true;
            }
            else if ((table11 != null) && (table2 != null))
            {
                if (table11.Rows.Count == table2.Rows.Count)
                {
                    if (table11.Columns.Count == table2.Columns.Count)
                    {
                        for (int i = 0; i < table11.Rows.Count; i++)
                        {
                            for (int j = 0; j < table11.Columns.Count; j++)
                            {
                                if (table11.Rows[i][j].ToString() != table2.Rows[i][j].ToString())
                                    return false;
                            }
                        }
                        return true;
                    }
                    else
                        return false;
                }
                else
                    return false;
            }
            else
                return false;
        }
    }
}
